package com.itheima.work.day5;

import java.util.Scanner;

public class Test4_2 {
    public static void main(String[] args)  {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学员姓名：");
        String name = sc.nextLine();

        System.out.println("请输入学员年龄：");
        String ageInput = sc.nextLine();
        int age = Integer.parseInt(ageInput);

        System.out.println("请输入学员身高：");
        String hightInput = sc.nextLine();
        double hight = Double.parseDouble(hightInput);

        System.out.println("请输入学员婚姻状态(是请输入true,否请输入其他任意值)：");
        String marryInput = sc.nextLine();
        Boolean marry = Boolean.parseBoolean(marryInput);

        System.out.println("请输入学员性别：");
        String genderInput = sc.nextLine();
        char gender = genderInput.charAt(0);

        Student student = new Student(name,age,hight,marry,gender);
        System.out.println(student.toString());

    }
}

class Student{
    private String name;
    private int age;
    private double hight;
    private boolean marry;
    private char gender;

    public Student() {
    }

    public Student(String name, int age, double hight, boolean marry, char gender) {
        this.name = name;
        this.age = age;
        this.hight = hight;
        this.marry = marry;
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", hight=" + hight +
                ", marry=" + marry +
                ", gender=" + gender +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getHight() {
        return hight;
    }

    public void setHight(double hight) {
        this.hight = hight;
    }

    public boolean isMarry() {
        return marry;
    }

    public void setMarry(boolean marry) {
        this.marry = marry;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }
}